//fun getScore(name:String) = if(name == "Tom"){
//    86
//} else if(name == "jim"){
//    77
//}else if(name == "Jack"){
//    95
//}else if(name == "Lily"){
//    100
//}else{
//    100
//}


//fun getScore(name:String) = when(name){
//    "Tom" -> 86
//    "Jim" -> 77
//    "Jack" -> 95
//    "Lily" -> 100
//    else -> 0
//}


//fun checkNumber(num:Number){
//    when(num){
//        is Int -> println("Number is Int")
//        is Double -> println("Number is Double")
//        is Float -> println("Number is Float")
//        else -> println("number is not support");
//    }
//}

//fun getScore(name:String) = when{
//    name == "Tom" -> 86
//    name == "Jim" -> 77
//    name == "Jack"-> 95
//    name == "Lily" -> 100
//    else -> 0
//}

fun getScore(name:String) = when{
    name.startsWith("Tom") -> 86
    name == "Jim" -> 77
    name == "Jack"-> 95
    name == "Lily" -> 100
    else -> 0
}

fun main(){
//    val num = 10
//    checkNumber(num)

//    val num = 10L
//    checkNumber(num)
}